home *** CD-ROM | disk | FTP | other *** search
/ Micromanía 85 / CDMM85_1.ISO / Monopoly Tycoon / MTycoonDemo.exe / data1.cab / scripts / TUTORIAL4 / hub.lua < prev    next >
Encoding:
Text File  |  2001-10-24  |  8.7 KB  |  195 lines

  1. PromptHeading = ID_TUTORIAL_4_OFFSET + 1
  2. g_currentprompt = 0;
  3. g_counter = 0;
  4. Tweaks.numyearsin24hours = 0;
  5.  
  6. -------------------------------------------------------------------------------------------------
  7. -- INITIALISE_Level. Standard level event
  8. -------------------------------------------------------------------------------------------------
  9. function EVENTINITIALISE_Level()
  10.     -- Game.Pause();
  11.     -- load the building and business file
  12.     C_RunScript("scripts\\maps\\tempmap.lua");
  13.     C_RunScript("scripts\\tutorial4\\initialpref.lua");
  14.  
  15. end;
  16.  
  17. -------------------------------------------------------------------------------------------------
  18. -- Level. Standard level event.
  19. -------------------------------------------------------------------------------------------------
  20. function EVENT_Level()
  21.     -- create an initial prompt
  22.     C_TriggerEvent("BlockCam", 1, PACIFIC_AVENUE);
  23.  
  24.     Interface.DisableAllControls();
  25.     Interface.DisableAll3DPicking();
  26.     Interface.DisableCameraControl();
  27.  
  28.     -- create the initial prompt
  29.     CreatePrompt(1);
  30. end;
  31.  
  32. function CATCHEVENT_InterfacePromptDismiss(a)
  33.     CreatePrompt(a);
  34. end;
  35.  
  36. function CATCHEVENT_TutorialEvent(a)
  37.  
  38.     if a == TUT_GAME_AUCTION_STARTTIMER and g_currentprompt == 17 then
  39.         Interface.DismissPrompt();
  40.         Interface.DisableControl(TUT_MPP_BLOCK_BUYBLOCK);
  41.         Game.Pause();
  42.     end;
  43.  
  44.     if g_currentprompt == 16 then
  45.         Interface.DismissPrompt();
  46.         Interface.DisableControl(TUT_MPP_GREENBUTTON_2);
  47.     end;
  48.  
  49.  
  50.     if g_currentprompt == 13 then
  51.         Interface.DismissPrompt();
  52.         Interface.DisableControl(TUT_MPP_INFOBUTTON_5);
  53.     end;
  54.  
  55.     if g_currentprompt == 10 then
  56.         Interface.DismissPrompt();
  57.         Interface.DisableControl(TUT_MPP_INFOBUTTON_4);
  58.     end;
  59.  
  60.     if g_currentprompt == 9 then
  61.         Interface.DismissPrompt();
  62.         Interface.DisableControl(TUT_MPP_BLOCK_LEFT_TOGGLE);
  63.         Interface.DisableControl(TUT_MPP_BLOCK_RIGHT_TOGGLE);
  64.     end;
  65.  
  66.     if g_currentprompt == 8 then
  67.         Interface.DismissPrompt();
  68.     end;
  69.  
  70.     if g_currentprompt == 6 then
  71.         Interface.DismissPrompt();
  72.         Interface.DisableControl(TUT_MPP_INFOBUTTON_3);
  73.     end;
  74.  
  75.     if g_currentprompt == 5 then
  76.         Interface.DismissPrompt();
  77.         Interface.DisableControl(TUT_MPP_BLOCK_LEFT_TOGGLE);
  78.         Interface.DisableControl(TUT_MPP_BLOCK_RIGHT_TOGGLE);
  79.         Interface.DisableControl(TUT_MPP_GREENBUTTON_6);
  80.     end;
  81.  
  82.     if g_currentprompt == 4 then
  83.         Interface.DismissPrompt();
  84.         Interface.DisableControl(TUT_MPP_BLOCK_LANDRENT);
  85.     end;
  86.  
  87.     if g_currentprompt == 3 then
  88.         Interface.DismissPrompt();
  89.         Interface.DisableControl(TUT_MPP_INFOBUTTON_2);
  90.     end;
  91.  
  92. end;
  93.  
  94. -- prompt manager
  95. function CreatePrompt(a)
  96.     g_currentprompt = a;
  97.     body = a+PromptHeading;
  98.     if a == 1 then
  99.         Interface.CreatePrompt(PromptHeading,body, a+1); --"Let's have a look at what you can do when you have a City Block selected. ", a+1);
  100.     elseif a == 2 then
  101.         Interface.CreatePrompt(PromptHeading,body, a+1); --"The default mode for this panel is Information. Here you can see some very top-line details regarding the block. ", a+1);
  102.         Interface.AddArrow( 46, 55 );
  103.     elseif a == 3 then
  104.         Interface.CreateMessage(PromptHeading,body, a+1); --"You can find out how much Land Rent is paid by each business by clicking on the Land Rent button. Try it now...", a+1);
  105.         Interface.AddArrow( 73, 54 );
  106.         Interface.EnableControl(TUT_MPP_INFOBUTTON_2);
  107.     elseif a == 4 then
  108.         Interface.CreateMessage(PromptHeading,body, a+1); --"All of the businesses are now listed, along with the amount of rent that they pay each day. Move the cursor over one of the stores and click. This will select the business. ", a+1);
  109.         Interface.EnableControlAndChildren(TUT_MPP_BLOCK_LANDRENT);
  110.         Interface.DisableControl(TUT_MPP_BUILDING_LEFT_TOGGLE);
  111.         Interface.DisableControl(TUT_MPP_BUILDING_RIGHT_TOGGLE);
  112.         Interface.AddArrow( 153, 156 );
  113.     elseif a == 5 then
  114.         Interface.CreateMessage(PromptHeading,body, a+1); --"This is a great way to select the business you want. Click on the Go To Block Button to return to Block Mode. ", a+1);
  115.         Interface.EnableControl(TUT_MPP_GREENBUTTON_6);
  116.         Interface.AddArrow( 29, 285 );
  117.     elseif a == 6 then
  118.         Interface.CreateMessage(PromptHeading,body, a+1); --"Now lets have a look at Profit. Click the button.", a+1);
  119.         Interface.DisableAllControls();
  120.         Interface.EnableControl(TUT_PROMPT_1);
  121.         Interface.EnableControl(TUT_MPP_INFOBUTTON_3);
  122.         Interface.AddArrow( 104, 54);
  123.     elseif a == 7 then
  124.         Interface.CreatePrompt(PromptHeading,body, a+1); --"The list of businesses is now accompanied by the amount of profit they are making. You are currently looking at today's numbers.", a+1);
  125.         Interface.DisableAllControls();
  126.         Interface.EnableControl(TUT_PROMPT_1);
  127.         Interface.AddArrow( 153, 156);
  128.     elseif a == 8 then
  129.         Interface.CreateMessage(PromptHeading,body, a+1); --"If it is early in the day, today's information may not be that helpful. If you need to check on yesterday's final numbers click here. ", a+1);
  130.         Interface.DisableAllControls();
  131.         Interface.EnableControl(TUT_PROMPT_1);
  132.         Interface.EnableControl(TUT_MPP_BLOCK_LEFT_TOGGLE);
  133.         Interface.EnableControl(TUT_MPP_BLOCK_RIGHT_TOGGLE);
  134.         Interface.AddArrow( 155, 87 );
  135.     elseif a == 9 then
  136.         Interface.CreateMessage(PromptHeading,body, a+1); --"Great. Now you can check to make sure all of your businesses made money yesterday. Click the button again to get back to today's list. ", a+1);
  137.         Interface.DisableAllControls();
  138.         Interface.EnableControl(TUT_PROMPT_1);
  139.         Interface.EnableControl(TUT_MPP_BLOCK_LEFT_TOGGLE);
  140.         Interface.EnableControl(TUT_MPP_BLOCK_RIGHT_TOGGLE);
  141.     elseif a == 10 then
  142.         Interface.CreateMessage(PromptHeading,body, a+1); --"Okay. Now click on the Efficiency Button.", a+1);
  143.         Interface.DisableAllControls();
  144.         Interface.EnableControl(TUT_PROMPT_1);
  145.         Interface.EnableControl(TUT_MPP_INFOBUTTON_4);
  146.         Interface.AddArrow( 128, 52 );
  147.     elseif a == 11 then
  148.         Interface.CreatePrompt(PromptHeading,body, a+1); --"Efficiency is very useful. The first number tells you how many units you have sold today, the second is how many items the store can hold. As the day progresses you can see sales being made. When the two numbers match it means that the store has sold out. ", a+1);
  149.         Interface.DisableAllControls();
  150.         Interface.EnableControl(TUT_PROMPT_1);
  151.         Interface.AddArrow( 153, 156);
  152.     elseif a == 12 then
  153.         Interface.CreatePrompt(PromptHeading,body, a+1); --"You can view yesterday's sales here as well, which is useful when checking if you have overstocked any of your stores. ", a+1);
  154.         Interface.DisableAllControls();
  155.         Interface.EnableControl(TUT_PROMPT_1);
  156.         Interface.AddArrow(131, 87 );
  157.     elseif a == 13 then
  158.         Interface.CreateMessage(PromptHeading,body, a+1); --"Click on the Buy Out / Sell Value button. ", a+1);
  159.         Interface.DisableAllControls();
  160.         Interface.EnableControl(TUT_PROMPT_1);
  161.         Interface.EnableControl(TUT_MPP_INFOBUTTON_5);
  162.         Interface.AddArrow( 159, 52);
  163.     elseif a == 14 then
  164.         Interface.CreatePrompt(PromptHeading,body, a+1); --"Values quoted beside businesses that you own are how much the city will give you if you were to sell them. ", a+1);
  165.         Interface.DisableAllControls();
  166.         Interface.EnableControl(TUT_PROMPT_1);
  167.         Interface.AddArrow( 153, 93);
  168.     elseif a == 15 then
  169.         Interface.CreatePrompt(PromptHeading,body, a+1); --"The values shown next to other businesses are how much it would cost you to buy them out if you were to become their Landlord. ", a+1);
  170.         Interface.DisableAllControls();
  171.         Interface.EnableControl(TUT_PROMPT_1);
  172.         Interface.AddArrow( 153, 140);
  173.     elseif a == 16 then
  174.         Interface.CreateMessage(PromptHeading,body, a+1); --"Speaking of being a Landlord, let's see how you get to be one. Click on the Lease Block button. ", a+1);
  175.         Interface.DisableAllControls();
  176.         Interface.EnableControl(TUT_PROMPT_1);
  177.         Interface.EnableControl(TUT_MPP_GREENBUTTON_2);
  178.         Interface.AddArrow( 30,  97);
  179.     elseif a == 17 then
  180.         Interface.CreateMessage(PromptHeading,body, a+1); --"There is a minimum offer price, but if you want you can increase this value. When you click the Lease Block button an auction will be triggered. The offer price that you set will be the opening bid. Click Lease Block now. ", a+1);
  181.         Interface.EnableControl(TUT_MPP_BLOCK_BUYBLOCK);
  182.         Interface.AddArrow( 140, 131);
  183.     elseif a == 18 then
  184.         Interface.CreatePrompt(PromptHeading,body, a+1); --"The auction has now been registered and will take place when the timer reaches zero. If the auction timer is running no one else is able to put in an offer for a block until after the auction. We will look at auctions in more detail in another tutorial. ", a+1);
  185.         Interface.AddArrow( 619, 104);
  186.     elseif a == 19 then
  187.         Interface.CreatePrompt(PromptHeading,body, a+1); --"Finally, there's the Build button. We have a special tutorial dedicated to this one. ", a+1);
  188.         Interface.AddArrow( 27, 118 );
  189.     elseif a == 20 then
  190.         Game.End(true);
  191.     end;
  192. end;
  193.  
  194.  
  195.